﻿using System;
using KKSG;
using UnityEngine;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x020010AF RID: 4271
	internal class Process_PtcG2C_FetchEnemyDoodadNtf
	{
		// Token: 0x0600D778 RID: 55160 RVA: 0x00327F48 File Offset: 0x00326148
		public static void Process(PtcG2C_FetchEnemyDoodadNtf roPtc)
		{
			Vector3 posid = new Vector3(roPtc.Data.doodadInfo.pos.x, roPtc.Data.doodadInfo.pos.y, roPtc.Data.doodadInfo.pos.z);
			//posid..ctor(roPtc.Data.doodadInfo.pos.x, roPtc.Data.doodadInfo.pos.y, roPtc.Data.doodadInfo.pos.z);
			uint num = 0U;
			XEntity p = null;
			uint playerroll = 0U;
			for (int i = 0; i < roPtc.Data.rollInfos.Count; i++)
			{
				if (roPtc.Data.rollInfos[i].rollValue > num)
				{
					num = roPtc.Data.rollInfos[i].rollValue;
					p = XSingleton<XEntityMgr>.singleton.GetEntityConsiderDeath(roPtc.Data.rollInfos[i].roleID);
				}
				if (roPtc.Data.rollInfos[i].roleID == XSingleton<XEntityMgr>.singleton.Player.ID)
				{
					playerroll = roPtc.Data.rollInfos[i].rollValue;
				}
				if (XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_PVP)
				{
					//zcg XBattleCaptainPVPDocument specificDocument = XDocuments.GetSpecificDocument<XBattleCaptainPVPDocument>(XBattleCaptainPVPDocument.uuID);
					//zcg specificDocument.AddGameInfo(roPtc.Data.rollInfos[i].roleID, roPtc.Data.doodadInfo.id);
				}
				else
				{
					if (XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT)
					{
						//zcg XGuildTerritoryDocument specificDocument2 = XDocuments.GetSpecificDocument<XGuildTerritoryDocument>(XGuildTerritoryDocument.uuID);
						//zcg specificDocument2.OnAddBuff(roPtc.Data.rollInfos[i].roleID, roPtc.Data.doodadInfo.id);
					}
				}
			}
			XSingleton<XLevelDoodadMgr>.singleton.OnDoodadPickedSyncSucc(roPtc.Data.doodadInfo.index, roPtc.Data.doodadInfo.waveid, posid, p, num, playerroll);
		}
	}
}
